/* eslint-disable */
import axios from './axios'
import qs from 'qs'
import { baseUrl } from '@/config/config'
var system = baseUrl + '/bdc/api/app/system' 
// 获取所有子系统列表（下拉框）
export const aggregateMenusOptions = (params) => {
        return new Promise((resolve, reject) => {
            axios({
                url: system + '/aggregateMenusOptions',
                method: 'get',
                params
            }).then(res => {
                resolve(res.data)
            }).catch(error => {
                reject(error)
            })
        })
    }
// /bdc/api/app/system/showChildMenus/{aggregateMenusId} 左侧列表展示
export const showChildMenus = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: system + '/showChildMenus/' + params.aggregateMenusId,
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        }).catch(error => {
            reject(error)
        })
    })
}
// /bdc/api/app/system/childMenusList 获取表格数据
export const childMenusList = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: system + '/childMenusList',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        }).catch(error => {
            reject(error)
        })
    })
}
// 新增栏目/bdc/api/app/system/childMenus
export const childMenus = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: system + '/childMenus',
            method: 'post',
            data: params
        }).then(res => {
            resolve(res.data)
        }).catch(error => {
            reject(error)
        })
    })
}
// /bdc/api/app/system/aggregateChildMenusOptions 获取顶级栏目列表
export const aggregateChildMenusOptions = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: system + '/aggregateChildMenusOptions/' + params.aggregateMenusId ,
            method: 'get'
        }).then(res => {
            resolve(res.data)
        }).catch(error => {
            reject(error)
        })
    })
}
// 编辑栏目/bdc/api/app/system/childMenus
export const editChildMenus = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: system + '/childMenus',
            method: 'put',
            data: params
        }).then(res => {
            resolve(res.data)
        }).catch(error => {
            reject(error)
        })
    })
}
  